﻿using GalaSoft.MvvmLight.Command;
using NicoView.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace NicoView.ViewModel
{
    public class NicoViewVideoInfoNicoViewViewModelBase:NicoViewViewModelBase
    {

        public NicoViewVideoInfoNicoViewViewModelBase() : this("", new Uri("http://www.nicovideo.jp"), "") { }

        public NicoViewVideoInfoNicoViewViewModelBase(string title, Uri thumbnailUrl, string videoId)
        {
            this.Title = title;
            this.ThumbnailUrl = thumbnailUrl;
            this.VideoId = videoId;
        }

        public string Title
        {
            get;
            private set;
        }


        public Uri ThumbnailUrl
        {

            get;
            private set;
        }

        public string VideoId
        {
            get;
            private set;

        }


        private ICommand executeVideoUrl;

        public ICommand ExecuteVideoUrl
        {
            get
            {
                if (executeVideoUrl == null)
                {
                    executeVideoUrl = new RelayCommand(() =>
                    {
                        NicoViewApplication.Current.ExecuteVideoUrl(this.VideoId);
                    });
                }

                return executeVideoUrl;
            }
        }
    }
}
